-
-
Notifications
You must be signed in to change notification settings - Fork 481
chore: Migrate from now.json to vercel.json #1173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Updated configuration to use 'umijs' framework.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Rate limit exceeded@afc163 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 2 minutes and 33 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Walkthrough将项目的Vercel部署配置从Now V2格式(now.json)迁移到现代Vercel格式(vercel.json),新配置文件指定构建框架为UmiJS。 Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello @afc163, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request updates the project's Vercel deployment configuration by transitioning from the legacy Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1173 +/- ##
=======================================
Coverage 99.41% 99.41%
=======================================
Files 31 31
Lines 1195 1195
Branches 403 425 +22
=======================================
Hits 1188 1188
Misses 7 7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request migrates the Vercel configuration from the legacy now.json to vercel.json, correctly specifying umijs as the framework. My review includes a suggestion to add the project name to the new configuration file to maintain consistency with the previous setup and avoid any unexpected changes to the project's name on Vercel.
| { | ||
| "framework": "umijs" | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous now.json configuration specified a project name with "name": "rc-select". To ensure consistency and prevent the project name on Vercel from changing unexpectedly, it's recommended to also add the name property to your vercel.json configuration.
| { | |
| "framework": "umijs" | |
| } | |
| { | |
| "name": "rc-select", | |
| "framework": "umijs" | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
now.json(0 hunks)vercel.json(1 hunks)
💤 Files with no reviewable changes (1)
- now.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Analyze (javascript)
| { | ||
| "framework": "umijs" | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
验证UmiJS框架标识符和配置完整性
需要确认"umijs"是否为Vercel支持的有效框架标识符,并验证这个最小化配置是否满足项目的部署需求。建议检查原始now.json中是否包含其他需要迁移的配置(如构建命令、输出目录、环境变量等)。
请运行以下脚本验证框架配置的有效性:
另外,您可以通过查阅最新的Vercel框架支持文档来确认"umijs"是否为有效的框架标识符:
🏁 Script executed:
#!/bin/bash
# 搜索项目中是否存在now.json或其备份,查看原始配置内容
fd -e json -type f | grep -E "(now|vercel)" | head -20
# 检查package.json中的UmiJS相关依赖
cat package.json | grep -A 5 -B 5 "umi"Length of output: 1011
🌐 Web query:
Vercel supported frameworks list umijs
💡 Result:
Yes — Vercel lists UmiJS as a supported framework and provides a deployment guide. See Vercel's supported frameworks list and the UmiJS deploy guide. [1][2]
Sources:
[1] Vercel — Supported Frameworks (includes UmiJS).
[2] Vercel guide: "How to Deploy an UmiJS App with Vercel" (deployment instructions).
需要进一步搜索now.json文件以验证配置完整性。让我运行修正的脚本:
---
🏁 Script executed:
```shell
#!/bin/bash
# 搜索now.json和vercel.json文件
fd -e json -type file | grep -E "(now|vercel)"
# 如果now.json存在,显示其内容
if [ -f "now.json" ]; then
echo "=== now.json content ==="
cat now.json
fi
# 如果vercel.json存在,显示其内容
if [ -f "vercel.json" ]; then
echo "=== vercel.json content ==="
cat vercel.json
fi
Length of output: 225
需要验证最小化配置是否充分。让我检查项目的构建配置:
---
🏁 Script executed:
```shell
#!/bin/bash
# 搜索项目中的部署相关配置文件
ls -la | grep -E "(vercel|now|build|\.vercel)"
# 检查是否存在构建或部署相关的环境配置
find . -maxdepth 2 -name ".*" -o -name "*config*" | grep -v node_modules | head -20
# 查看package.json中的build脚本
echo "=== Build scripts ==="
grep -A 2 '"build"' package.json
Length of output: 402
需要最后确认Vercel对UmiJS最小配置的支持情况:
---
🌐 Web query:
```web
Vercel UmiJS minimal configuration framework only
💡 Result:
Summary — minimal Vercel setup to deploy an UmiJS app (static output)
- package.json (scripts)
- Ensure you have a build script that runs Umi:
{
"scripts": {
"build": "npx umi build",
"dev": "npx umi dev",
"start": "npx umi dev"
}
}
- vercel.json (minimal, puts Vercel build and serves Umi's dist)
- Create vercel.json at project root:
{
"buildCommand": "npx umi build",
"outputDirectory": "dist"
}
Notes
- Umi’s production build outputs to dist by default (so outputDirectory = "dist"). [1]
- Vercel will run the buildCommand and serve the files from outputDirectory. Use vercel.json properties buildCommand/outputDirectory to override project settings. [2][3]
- If your Umi app needs server-side Node APIs (not just static files), you’ll need a different configuration (Vercel Functions or a server runtime) — the above is for static-only builds.
Sources
[1] Umi build output ("npx umi build" → dist).
[2] Vercel docs — vercel.json: buildCommand / outputDirectory.
[3] Vercel project-configuration docs / changelog (per-deployment overrides).
补充buildCommand和outputDirectory配置
vercel.json配置不完整。虽然"umijs"是Vercel支持的有效框架标识符,但Vercel建议在vercel.json中显式指定buildCommand和outputDirectory来确保正确部署。根据UmiJS的默认构建输出为dist目录,建议修改为:
{
"buildCommand": "npm run build",
"outputDirectory": "dist"
}注意:项目中build脚本为"dumi build"而非"umi build",请确保这与UmiJS的默认构建行为兼容,或根据实际输出目录调整outputDirectory的值。
🤖 Prompt for AI Agents
In vercel.json around lines 1 to 3, the config only specifies "framework":
"umijs" and lacks explicit buildCommand and outputDirectory; add a buildCommand
(e.g. "npm run build") and an outputDirectory (e.g. "dist") to ensure Vercel
builds and serves the correct output, and if the project's package.json uses a
different build script (here "dumi build") or outputs to a different folder, set
buildCommand to that script and outputDirectory to the actual build output
directory accordingly.
Updated configuration to use 'umijs' framework.
Summary by CodeRabbit
发布说明
✏️ Tip: You can customize this high-level summary in your review settings.